package com.mobimap.nhom9.gui;

import android.content.Context;



public class Container {
	public static final int TILE_WIDTH = 256;
	public static final int TILE_HEIGHT = 256;
	private static Container instance;

	private IMapProvider mapProvider;
	private int zoom;
	private int maxZoom;
	private int minZoom;
	
	protected Container(Context ctx) {
		this.mapProvider = new LocalMapProvider();
		this.minZoom = 15;
		this.maxZoom = 16;
		this.setZoom(minZoom);
	}

	public synchronized static void InitContainer(Context ctx) {
		if(instance == null)
			instance = new Container(ctx);
	}

	public static Container getInstance() {
		if(instance == null)
			throw new RuntimeException("Please call method InitContainer before");
		return instance;
	}

	public String getResourceDirectory() {
		return "/mnt/sdcard";
	}

	public IMapProvider getMapProvider() {
		return mapProvider;
	}

	public void setMapProvider(IMapProvider mapProvider) {
		this.mapProvider = mapProvider;
	}

	public synchronized int getZoom() {
		// TODO Auto-generated method stub
		return zoom;
	}

	public synchronized void setZoom(int zoom) {
		this.zoom = zoom;
	}

	public int getMaxZoom() {
		return maxZoom;
	}

	public void setMaxZoom(int maxZoom) {
		this.maxZoom = maxZoom;
	}

	public int getMinZoom() {
		return minZoom;
	}

	public void setMinZoom(int minZoom) {
		this.minZoom = minZoom;
	}

}
